<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">
	<h:form>
		<h:panelGrid columns="2">
			<h:outputText value="Username" />
			<h:inputText value="#{user.username}" id="username" />
			<h:outputText value="Password" />
			<h:inputText value="#{user.password}" id="password" >
			<f:ajax event="keyup" listener="#{user.saveAttributes}" render="username"/>
			</h:inputText>
			<h:link value="Sign In">
				<f:ajax event="click" render="render" listener="#{user.signIn}" />
			</h:link>
			<h:outputText value=" "></h:outputText>
		</h:panelGrid>
		<h:panelGrid id="render"> 
		<h:outputText value="All Checks Out!" rendered="#{user.signedIn}" />
		<h:outputText value="Try again!" rendered="#{user.signedIn==false}" />
		</h:panelGrid>
	</h:form>
</ui:composition>